package com.chinacoal.hr.levelapi.client;

import com.baomidou.mybatisplus.plugins.Page;
import com.chinacoal.hr.levelapi.client.fallback.XtptCommonClientFallback;
import com.chinacoal.hr.levelapi.entity.Employee;
import com.chinacoal.hr.levelapi.util.XtptOrgEmployee;
import com.chinacoal.hr.levelapi.util.XtptOrgOrganization;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.cloud.openfeign.FeignAutoConfiguration;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;
import java.util.Map;

/**
 * Created by jinyabin on 2020/11/24.
 */
@Api(tags = { "协同平台项目公用操作" })
@FeignClient(name = "xtpt-base", configuration = FeignAutoConfiguration.class, fallback = XtptCommonClientFallback.class)
public interface XtptCommonClient {

    /**
     * 获取机构或者部门
     *
     * @param  :  Map<String, Object> condition
     * @return : XtptResult
     * @author : jinyb
     * @date : 2020/11/24
     */
    @ResponseBody
    @GetMapping("/xtptBase/organizations")
    @ApiOperation(value = "获得机构列表")
    public List<XtptOrgOrganization> getOrganizationList(@ApiParam("组织机构") @RequestBody Map<String, Object> condition)throws Throwable ;



    /**
     * 查询员工信息列表,带分页
     *
     * @param Map<String, Object>  : condition
     * @return : com.chinacoal.hr.levelapi.response.Result
     * @author : jinyb
     * @date : 2020/11/26
     */
    @ResponseBody
    @GetMapping("/emps")
    @ApiOperation(value = "查询员工信息列表")
    public Page<XtptOrgEmployee> getEmployeeslList(@ApiParam("员工信息") @RequestBody Map<String, Object> condition);




}
